<template>
  <div class="header-box">
    <div class="left-header">
      <el-button
      class="header-btn"
        @click="menuButton()"
        icon="el-icon-menu"
        size="mini"
      ></el-button>


      <!-- 面包屑 -->

      <el-breadcrumb separator="/">
        <el-breadcrumb-item v-for="item in tags" :key="item.path" :to="{ path: item.path }">{{item.label}}</el-breadcrumb-item>
      </el-breadcrumb>


    </div>
    <div class="right-header">
      <el-dropdown>
        <span class="el-dropdown-link">
          <img class="user-img" src="@/assets/logo.png" alt="" />
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>用户中心</el-dropdown-item>
          <el-dropdown-item>退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<style>
.header-box {
  color: #fff;
  background-color: #555;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}
.left-header-text {
  margin-left: 10px;
}
.left-header{
  display: flex;
  justify-content: center;
  align-items: center;
}
.header-btn{
  margin-right: 10px;
}
.user-img {
  width: 40px;
  height: 40px;
}

.el-breadcrumb__item:last-child .el-breadcrumb__inner{
  color: #999;
  cursor: pointer;
}
.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{
  color: #ffff;
}
.el-breadcrumb__inner{
  color: #999;
}
.el-breadcrumb__inner.is-link{
  color: #777;
}

.el-breadcrumb__inner.is-link:hover{
  color: #fff;
}

</style>

<script>
import {mapState} from 'vuex'

export default {
  data() {
    return {};
  },
  methods: {
    // 控制导航菜单收缩
    menuButton() {
      this.$store.commit("collapseMenu");
    },
  },
  computed:{
    ...mapState({
      tags:state=>state.tab.tabList
    })
  }
};
</script>